import QtQuick 2.12

import QtQuick

import QtQuick.Controls

import "./widget"
///创建游戏画布和块
Rectangle {
    id: screen

    width: 490; height: 720

    //SystemPalette 是一个用于访问系统默认颜色调色板的 QML 类型。它提供了一组标准的颜色值，这些值通常与操作系统当前的主题或配色方案一致，使得应用程序的 UI 能够自然地融入系统风格。
    SystemPalette { id: activePalette }

    Item {
        width: parent.width
        anchors { top: parent.top; bottom: toolBar.top }

        Image {
            id: background
            anchors.fill: parent
            source: "images/background.jpeg"
            fillMode: Image.PreserveAspectCrop //Image.PreserveAspectFit //
        }
    }

    Rectangle {
        id: toolBar
        width: parent.width; height: 30
        color: activePalette.window
        anchors.bottom: screen.bottom

        ButtonWidget {
            anchors { left: parent.left; verticalCenter: parent.verticalCenter }
            text: "New Game"
            onClicked: console.log("This doesn't do anything yet...")
        }

        Text {
            id: score
            anchors { right: parent.right; verticalCenter: parent.verticalCenter }
            text: "Score: Who knows?"
        }
    }
}
